// ****************************************************************************
//
// Logic 94: Death handler
// This logic is run when the player dies.
// The death message displayed depends on the value of death_type.
//
// ****************************************************************************

#include "defines.txt"

if (v35 != 255) {           // if death_type = 255, the death message has
                           // already been displayed
  accept.input();
  cancel.line();
  program.control();
  clear.lines(23, 24, 0);
  v36 = 12;

  if (v35 == 1) {
    print("You are now dead.");
  }

  if (v35 == 2) {
    print("You are now dead.");
    print("See what happens when you go around picking your nose?");
  }

  if (v35 == 3) {
    print("You are now dead.");
    print("See what happens when you go messing with innocent trees?");
  }

  // add messages for other death types here

  v35 = 255;          // set death_type to 255 so this logic does not display
                     // the death message again
}

v36--;

if (v36 == 1) {
  load.sound(2);
  sound(2,f16);
  print("Thank you for playing this game. Better luck next time!");
}

if (controller(c19)) {
  menu.input();
}

if ((controller(menu_help) ||
     said("help"))) {
  call(92);
}

if ((controller(menu_restore) ||
     said("restore", "game") ||
     said("restore"))) {
  restore.game();
}

if ((controller(menu_restart) ||
     said("restart", "game") ||
     said("restart"))) {
  restart.game();
}

if ((controller(menu_inventory) ||
     said("inventory"))) {
  status();
}

if ((controller(menu_quit) ||
     said("quit"))) {
  stop.sound();
  quit(0);
}

if (f2 &&
    !input_parsed) {
  print("You are dead! You can only restore, restart, quit the game"
        " or view your inventory if you wish (over your dead body!) .");
}

return();